package com.niguang.schedule;


import com.niguang.common.pojo.Result;
import com.niguang.work.api.service.WechatUserService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 入职员工推送
 */

@JobHandler("pushWeChateTitle")
@Component
@Slf4j
public class SchedulePushUser extends IJobHandler {

    @Resource
    private WechatUserService wechatUserService;


    @Override
    public ReturnT<String> execute(String param) {
        log.info("---------新员工入职微信开始推送--------");
        Result result = wechatUserService.pushWeChateTitle();
        log.info("---------新员工入职微信推送返回结果：{}", result);
        return ReturnT.SUCCESS;
    }
}
